Towards Efficient, Typed LR Parsers

نویسندگان

  • François Pottier
  • Yann Régis-Gianas
چکیده

The LR parser generators that are bundled with many functional programming language implementations produce code that is untyped, needlessly inefficient, or both. We show that, using generalized algebraic data types, it is possible to produce parsers that are well-typed (so they cannot unexpectedly crash or fail) and nevertheless efficient. This is a pleasing result as well as an illustration of the new expressiveness offered by generalized algebraic data types.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Linear Time Parsers for Classes of Non Context Free Languages

Deterministic parsers have been proposed for two-level control grammars. These parsers are efficient in both time and space and are simple extensions of the standard LL(I) and LR( 1) parsers for deterministic context free languages. An important advantage of the parsers proposed here is that existing parser generator tools can be augmented to generate them from grammar specifications. Since the...

متن کامل

Construction of Efficient Generalized LR Parsers

We show how LR parsers for the analysis of arbitrary contextfree grammars can be derived from classical Earley’s parsing algorithm. The result is a Generalized LR parsing algorithm working at complexity O(n) in the worst case, which is achieved by the use of dynamic programming to represent the non-deterministic evolution of the stack instead of graph-structured stack representations, as has of...

متن کامل

Partial Evaluation of General Parsers – Slightly Revised

Applications of partial evaluation have so far mainly focused on generation of compilers from interpreters for programming languages. We partially evaluate a simple general LR(k) parsing algorithm. To obtain good results, we rewrite the algorithm using a number of binding-time improvements. The final LR(1) parser has been specialized using Similix, a partial evaluator for a higher order subset ...

متن کامل

Error Recovery in LR Parsers

This report presents a survey of four syntax error recovery techniques for LR Parsers. The techniques presented are described in [Modry 78, Graham 79, Sippu 83, Mckenzie 95, Bertsch 99]. After an introduction to general syntactic error recovery techniques in LR parsers, I would present a brief overview and comparison of these techniques in this report.

متن کامل

Faster Generalized LR Parsing

Tomita devised a method of generalized LR (GLR) parsing to parse ambiguous grammars e ciently. A GLR parser uses linear-time LR parsing techniques as long as possible, falling back on more expensive general techniques when necessary. Much research has addressed speeding up LR parsers. However, we argue that this previous work is not transferable to GLR parsers. Instead, we speed up LR parsers b...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Electr. Notes Theor. Comput. Sci.

دوره 148  شماره 

صفحات  -

تاریخ انتشار 2006